from common.base import BasePage
from selenium.webdriver.common.by import By


class RegPage(BasePage):
    unameE = (By.NAME, "username")
    uemailE = (By.NAME, "email")
    upwdE = (By.NAME, "password")
    upwdE2 = (By.NAME, "confirm_password")
    uphoE=(By.NAME,"extend_field5")
    regE = (By.NAME, "Submit")


    def zhuce(self,http,a, b, c, d,e):
        # 通过实例打开网页
        self.driver.get(http)
        self.getElement(*self.unameE).send_keys(a)
        self.getElement(*self.uemailE).send_keys(b)
        self.getElement(*self.upwdE).send_keys(c)
        self.getElement(*self.upwdE2).send_keys(d)
        self.getElement(*self.uphoE).send_keys(e)
        self.getElement(*self.regE).click()


if __name__ == '__main__':
    rp = RegPage()
    rp.zhuce(http='http://172.16.0.30/user.php?act=register',a='wu2',b='2411617785@qq.com', c="123456", d="123456",e="12359878965")